package com.cn.wanxi.service.impl;

import com.cn.wanxi.entity.OnlineEntity;
import com.cn.wanxi.mapper.OnlineMapper;
import com.cn.wanxi.service.IOnlineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OnlineServiceImpl implements IOnlineService {

    @Autowired
    private OnlineMapper onlineMapper;


    @Override
    public List<OnlineEntity> findAll(OnlineEntity onlineEntity) {

        return onlineMapper.findAll(onlineEntity);
    }

    @Override
    public int getCount(OnlineEntity onlineEntity) {

        return onlineMapper.getCount(onlineEntity);
    }

    @Override
    public int del(Integer id) {

        return onlineMapper.del(id);
    }

    @Override
    public OnlineEntity findById(Integer id) {

        return onlineMapper.findById(id);
    }

    @Override
    public String edit(OnlineEntity onlineEntity) {

        return onlineMapper.edit(onlineEntity) == 1 ? "success" : "error";
    }

    @Override
    public String add(OnlineEntity onlineEntity) {

        return onlineMapper.add(onlineEntity) == 1 ? "success" : "error";
    }

}
